<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Log;

use App\Http\Services\Messages\SendMessageService;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        // Commands\Users::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        ini_set('memory_limit', '1024M');
        set_time_limit(0);
       /* $schedule->call(function () {
            // app(MonthReportRepository::class)->sendMessages();
//            app(SendMessageService::class)->send(['type' => MessageTemplate::TYPE_MONTH_REPORT]);
            Log::info('每月的24号 上午10点运行一次');
        })->monthlyOn(24, '10:00');
       */
        // $schedule->command('users')->everyMinute();
    }
    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
